package com.iie.bigVideo.controller;


import com.iie.bigVideo.entity.dto.UserDto;
import com.iie.bigVideo.service.UserService;
import com.iie.bigVideo.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author XXX
 * @since 2023-11-20
 */
@RestController
@RequestMapping("/user")
@CrossOrigin //跨域
public class UserController {


    @Autowired
    private UserService userService;


    /**
     * 普通用户登录
     *
     * @param userName 用户名
     * @param password 密码
     * @return
     */
    @PostMapping("/login")
    public ResultVO<UserDto> userLogin(@RequestParam("userName") String userName, @RequestParam("password") String password) {
        return userService.login(userName, password);
    }
}

